#include "./loopinfodockbuilder.h"
#include <QLineEdit>

LoopInfoDockBuilder::LoopInfoDockBuilder()
{
}

QVector<QLayout *> LoopInfoDockBuilder::_prepareInfoLabel(QSqlRecord record)
{
    QVector<QLayout*> result;

    QLayout *headerLayout = new QVBoxLayout();
    QLabel * header = new QLabel("Loop " + record.value("idGeneratorLoop").toString());
    QFont font = header->font();
    font.setBold(true);
    header->setFont(font);
    headerLayout->addWidget(header);
    result.push_back(headerLayout);

    QLayout *xLayout = new QHBoxLayout();
    QLineEdit *xEdit = new QLineEdit(record.value("centerX").toString());
    xEdit->setReadOnly(true);
    xEdit->setAlignment(Qt::AlignCenter);
    xLayout->addWidget(new QLabel("x: "));
    xLayout->addWidget(xEdit);
    result.push_back(xLayout);

    QLayout *yLayout = new QHBoxLayout();
    QLineEdit *yEdit = new QLineEdit(record.value("centerY").toString());
    yEdit->setReadOnly(true);
    yEdit->setAlignment(Qt::AlignCenter);
    yLayout->addWidget(new QLabel("y: "));
    yLayout->addWidget(yEdit);
    result.push_back(yLayout);

    return result;
}
